package hg.framework.validators.annotation;

import hg.framework.validators.validator.HgPhoneValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 注解-参数验证-手机号
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {HgPhoneValidator.class}) // 指定此注解的实现，即:验证器
public @interface HgPhone {
    boolean required() default true;

    String message() default "手机号,非法";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
